#include <amxmodx>
#include <fun>
#include <rpgx>

#define healthcalc (100 + (25 * RPGx_GetUpgradeLevel(id, upgrade_id)))

new upgrade_id;

public plugin_init()
	register_plugin("Health+ RPGx Upgrade", "2.0", "roflmao456");

public RPGx_OnPluginReady()
	upgrade_id = RPGx_MakeUpgrade("Health+", 6, 10, 10);

public RPGx_OnPlayerAuth(id)
	RPGx_SetSpawnHealth(id, healthcalc);

public RPGx_OnUpgradePurchase(id, upgrade, newlevel){
	if(upgrade == upgrade_id){
		RPGx_SetSpawnHealth(id, healthcalc);
		set_user_health(id, healthcalc);
		}
	}

public RPGx_OnUpgradeSell(id, upgrade, newlevel){
	if(upgrade == upgrade_id){
		RPGx_SetSpawnHealth(id, healthcalc);
		set_user_health(id, healthcalc);
		}
	}